<template>
  <div>
    <el-container class="main_container">
      <el-aside width="256px" style="background-color: rgba(0, 21, 41, 1)">
        <div class="main_title">人事贯通</div>
        <el-menu
          background-color="rgba(0, 21, 41, 1)"
          text-color="#a5acb3"
          :default-active="activeKey"
          active-text-color="#fff"
          @select="handleSelect"
        >
          <el-menu-item index="/indexPage"
            ><i class="el-icon-s-home"></i>首页</el-menu-item
          >
          <el-submenu index="/keyIndicators">
            <template slot="title">
              <i class="el-icon-edit"></i>重点指标管理
            </template>
            <el-menu-item index="/keyIndicators">辖区指标管理</el-menu-item>
            <el-menu-item index="/streetKey"
              >镇(街)指标管理</el-menu-item
            ></el-submenu
          >
          <el-submenu index="/contentManage">
            <template slot="title"
              ><i class="el-icon-document"></i>内容管理</template
            >
            <el-menu-item index="/marketManage">重点关注任务管理</el-menu-item>
            <el-menu-item index="/contentManage">自主申报工作管理</el-menu-item>
          </el-submenu>
          <el-submenu index="/infoMaintain">
            <template slot="title"
              ><i class="el-icon-setting"></i>信息配置</template
            >
            <!-- <el-menu-item index="/streetMaintain">镇街负责人信息维护</el-menu-item> -->
            <el-menu-item index="/personnelInfo">人员信息</el-menu-item>
            <el-menu-item index="/infoMaintain">指标信息维护</el-menu-item>
            <el-menu-item index="/noticeSetting">通知配置</el-menu-item>
            <el-menu-item index="/warnSetting">警告提醒配置</el-menu-item>
            <!-- <el-menu-item index="/personMaintain">责任人信息维护</el-menu-item> -->
            <el-menu-item index="/noticeFeedback">异常反馈处理</el-menu-item>
            <el-menu-item index="/plateNoticeFeedback"
              >平台异常反馈处理</el-menu-item
            >
          </el-submenu>
          <el-menu-item index="/operationLog"
            ><i class="el-icon-notebook-2"></i>操作日志</el-menu-item
          >
        </el-menu>
      </el-aside>
      <el-container>
        <el-header class="main_header">
          <el-dropdown
            class="avatar-container right-menu-item hover-effect"
            trigger="click"
          >
            <div class="user_box">
              <img src="../assets/admin.png" /><span>管理员</span>
            </div>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item divided @click.native="logout">
                <span style="display: block">退出登录</span>
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </el-header>
        <el-main class="main_content">
          <div class="main_wrap">
            <router-view />
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "HomePage",
  data() {
    return {
      activeKey: "",
    };
  },
  created() {
    // this.$router.push("/indexPage");
  },
  mounted() {
    this.activeKey = this.$route.path;
  },
  methods: {
    handleSelect(key) {
      this.$router.push(key);
    },
    logout() {
      localStorage.removeItem("token");
      this.$router.push("/login");
    },
  },
};
</script>

<style scoped></style>
